#include "stdafx.h"
#include "GameResouce.h"


CGameResource::CGameResource()
{
}


CGameResource::~CGameResource()
{
}

void CGameResource::InitImage()
{
	char filename[100];
	for (int i = 0; i < ENEMY_IMG_COUNT; i++)
	{
		sprintf(filename, "img\\enemy\\bigEnemy%d.jpg", i);
		m_EnemyImage[i] = cvLoadImage(filename);
	}

	for (int i = 0; i < CARROT_IMG_COUNT; i++)
	{
		sprintf(filename, "img\\carrot\\%d.jpg", i + 1);
		m_CarrotImage[i] = cvLoadImage(filename);
	}
}

void CGameResource::ReleaseImage()
{
	for (int i = 0; i < ENEMY_IMG_COUNT; i++)
	{
		cvReleaseImage(&m_EnemyImage[i]);
	}
	
	for (int i = 0; i < CARROT_IMG_COUNT; i++)
	{
		cvReleaseImage(&m_CarrotImage[i]);
	}
}
